<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->systemName;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>

<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jQselect.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>
</head>

<body>
	<div id="main">
		<div id="topMenu">
			<div id="navigation">当前位置：Source列表</div>
	        <div id="topOtherMenu">
			  <div align="right"></div>
		  </div>
		</div>
		<div id="body">
			<div id="search">
				<form id="searchForm" name="searchForm" method="post" action="<?php echo $this->projectUrl();?>">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td>
								SourceId
								  ：
								  <input type="text" id="sourceId" name="sourceId" value="<?php echo $this->sourceId;?>" class="input" />
							  &nbsp;渠道：
								  <input type="text" id="memberName" name="memberName" value="<?php echo $this->memberName;?>" class="input" />
&nbsp;
				              <input type="submit" name="button" id="button" value="查找" class="button" />
						  </td>
						</tr>
					</table>
				</form>
			</div>
			<div id="content">
				<form id="listForm" name="listForm" method="post" action="<?php echo $this->projectUrl();?>">
					<table width="100%" class="table">
						<tr class="subject">                        
						  <td class="checkBoxTd">选择</td>
						  <td>产品</td>
						  <td>SourceId</td>
						  <td width="16%">SubSourceId</td>
						  <td width="16%">SourceName</td>
						  <td>渠道</td>
						  <td>添加时间</td>
						  <td class="checkBoxTd">操作</td>
					  </tr>
                        <?php foreach($this->rows as $row):?>
                        <?php if($row['sourceSubId']):?>
						<tr class="dataLine">
                         
						  <td class="checkBoxTd"><input type="checkbox" name="selectId[]" id="select0" class="selectCheckBox" value="<?php echo $row['id'];?>" /></td>
							<td><?php echo $row['productName'];?></td>
							<td><?php echo $row['sourceId'];?></td>
							<td><?php echo $row['sourceSubId'];?></td>
							<td><?php echo $row['sourceName'];?></td>
							<td><?php echo trim($row['memberName']) == '' ? '<span style="color:#f00;">渠道已删除</span>' : $row['memberName'];?></td>
							<td><?php echo $row['addTime'];?></td>
							<td class="checkBoxTd">
							<a href="<?php echo $this->projectUrl(array('controller'=>'source-schedual','action'=>'index','sourceId'=>$row['sourceId'],'sourceSubId'=>$row['sourceSubId']));?>">查看排期(<?php 
							$schModel = new Application_Model_SourceSchedual();
							echo $schModel->getSchNum($row['sourceId'],$row['sourceSubId']);?>)</a>  <a href="<?php echo $this->projectUrl(array('controller'=>'source-schedual','action'=>'insert','sourceId'=>$row['sourceId'],'sourceSubId'=>$row['sourceSubId']));?>">添加排期</a>                           </td>
					  </tr>
                      <?php endif;?>
                        <?php endforeach;?>
				  </table>
<table class="controlTable">
						<tr>
							<td align="left"><input type="button" name="all" id="all" value="全选" class="button" onclick="$('.selectCheckBox').attr('checked', true);"/>
								<input type="button" name="cancel" id="cancel" value="取消" class="button" onclick="$('.selectCheckBox').attr('checked', false);"/>
                                
								<input type="submit" name="delete" id="delete" value="删除选中" class="button" onclick="return del();"/></td>
							 <td colspan="6" class="paginator"><div align="right"><?php echo $this->pageString;?></div></td>
		  </tr>
				  </table>
			  </form>
			</div>
		</div>
</div>
<script language="javascript">
function del()
{
	if (confirm('确定删除吗？')) {
		$("#listForm").attr('action', '<?php echo $this->projectUrl(array('action'=>'delete','backUrl'=>urlencode($this->pageUrl))) ;?>');
		$("#listForm").submit();
		return true;
	} else {
		return false;
	}
}
</script>

</body>
</html>